package com.acmen.easyapi.model;
/**
 * @date 2022-03-16
 * @author acmen
 * 接口详细信息
 */

import com.alibaba.fastjson.annotation.JSONField;

import java.lang.reflect.Method;
import java.time.LocalDateTime;

/**
 *@date 2022-01-25
 * @author acmen
 * 接口详细信息
 */
public class Api {
    private String id;
    private Integer idx;
    private String module;//所属模块
    private String name;//接口名
    private String no;//接口编号
    private String appName;
    private String requestMethod;//请求方法
    private String path;//接口访问路径
    private String author;//作者
    private String note;//接口说明
    private String permission;//权限字符
    private boolean completed = true;//是否完成
    @JSONField(serialize = false)
    private Method javaMethod;
    private Rpc rpc;
    private ReqParamNode reqParamNode;//请求
    private ResParamNode resParamNode;//响应

    @JSONField(serialize = false)
    private String md5;
    @JSONField(serialize = false)
    private LocalDateTime createDt;
    /**
     * 创建人
     */
    private String creator;

    public Api(String name, String requestMethod, String path) {
        this.name = name;
        this.requestMethod = requestMethod;
        this.path = path;
    }

    public Api() {

    }

    public String getId() {
        return id;
    }

    public Api setId(String id) {
        this.id = id;
        return this;
    }

    public String getModule() {
        return module;
    }

    public Api setModule(String module) {
        this.module = module;
        return this;
    }

    public String getName() {
        return name;
    }

    public Api setName(String name) {
        this.name = name;
        return this;
    }

    public String getNo() {
        return no;
    }

    public Api setNo(String no) {
        this.no = no;
        return this;
    }

    public String getAppName() {
        return appName;
    }

    public Api setAppName(String appName) {
        this.appName = appName;
        return this;
    }

    public String getRequestMethod() {
        return requestMethod;
    }

    public Api setRequestMethod(String requestMethod) {
        this.requestMethod = requestMethod;
        return this;
    }

    public String getPath() {
        return path;
    }

    public Api setPath(String path) {
        this.path = path;
        return this;
    }

    public String getAuthor() {
        return author;
    }

    public Api setAuthor(String author) {
        this.author = author;
        return this;
    }

    public String getNote() {
        return note;
    }

    public Api setNote(String note) {
        this.note = note;
        return this;
    }

    public boolean isCompleted() {
        return completed;
    }

    public Api setCompleted(boolean completed) {
        this.completed = completed;
        return this;
    }

    public Method getJavaMethod() {
        return javaMethod;
    }

    public Api setJavaMethod(Method javaMethod) {
        this.javaMethod = javaMethod;
        return this;
    }

    public Rpc getRpc() {
        return rpc;
    }

    public Api setRpc(Rpc rpc) {
        this.rpc = rpc;
        return this;
    }

    public ReqParamNode getReqParamNode() {
        return reqParamNode;
    }

    public Api setReqParamNode(ReqParamNode reqParamNode) {
        this.reqParamNode = reqParamNode;
        return this;
    }
    public ResParamNode getResParamNode() {
        return resParamNode;
    }
    public Api setResParamNode(ResParamNode resParamNode) {
        this.resParamNode = resParamNode;
        return this;
    }
    public String getMd5() {
        return md5;
    }

    public Api setMd5(String md5) {
        this.md5 = md5;
        return this;
    }
    public LocalDateTime getCreateDt() {
        return createDt;
    }

    public Api setCreateDt(LocalDateTime createDt) {
        this.createDt = createDt;
        return this;
    }

    public String getCreator() {
        return creator;
    }

    public Api setCreator(String creator) {
        this.creator = creator;
        return this;
    }

    public Integer getIdx() {
        return idx;
    }

    public Api setIdx(Integer idx) {
        this.idx = idx;
        return this;
    }

    public String getPermission() {
        return permission;
    }

    public Api setPermission(String permission) {
        this.permission = permission;
        return this;
    }
}
